define(function () {
    var setTemplate = function (template) {
        this.template = template;
    };
    var setModel = function (model) {
        this.model = model;
    };
    var render = function (container) {
        // 获取模板
        var templateStr = this.template;
        var resourceObj = this.model;
        var regS = null;
        // 替换模板
        for (var key in resourceObj) {
            regS = new RegExp("\\{" + key + "\\}", "g");
            templateStr = templateStr.replace(regS, resourceObj[key]);
        }
        // 加载页面
        container.innerHTML = templateStr;
    };
    return {
        setTemplate: setTemplate,
        setModel: setModel,
        render: render
    }
});